﻿Public Class ReportViewerWindow
    Dim _ID As Integer
    Public WriteOnly Property ID As Integer
        Set(ByVal value As Integer)
            _ID = value
        End Set
    End Property

    Dim _PatientID As Integer
    Public WriteOnly Property PatientID As Integer
        Set(ByVal value As Integer)
            _PatientID = value
        End Set
    End Property

    Public Property VisitID As Integer

    Public Property DrID As Integer

    Public Property ReportType As ReportsList
    Dim rpt As ReportViewerUserControl

    Private Sub ReportViewerWindow_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Me.Loaded
        rpt = WindowsFormsHost1.Child
        rpt.ReportType = Me.ReportType
        rpt.ID = _ID
        rpt.PatientID = _PatientID
        rpt.DrID = DrID
        rpt.VisitID = VisitID
        'If Me.ReportType = ReportsList.BillCumReceipt Then
        '    FilterGrid.Visibility = Visibility.Collapsed
        '    rpt.SetReport()
        'Else
        '    StartDatePicker.DisplayDateEnd = Date.Now
        '    EndDatePicker.DisplayDateEnd = Date.Now
        'End If
        rpt.SetReport()

        Select Case _ReportType
            Case ReportsList.SalesSummary
                'LoadSalesSummary()
            Case ReportsList.BillCumReceipt
                Me.Title = "Bill Cum Receipt"
            Case ReportsList.AdvPayReceipt
                Me.Title = "Payment Receipt"
            Case ReportsList.RegisterBill
                Me.Title = "Bill Register"
            Case ReportsList.RegisterPatient
                Me.Title = "Patient Register"
            Case ReportsList.RegisterComplaints
                Me.Title = "Complaints Register"
            Case ReportsList.RegisterDoctors
                Me.Title = "Doctors Register"
            Case ReportsList.RegisterEmp
                Me.Title = "Empployee Register"
            Case ReportsList.RegisterItems
                Me.Title = "Items Register"
            Case ReportsList.RegisterServices
                Me.Title = "Services Register"
            Case ReportsList.RegisterVendors
                Me.Title = "Vendors Register"
            Case ReportsList.PrescriptionReport
                Me.Title = "Prescription"
        End Select
    End Sub
End Class
